import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { ColumnType, SPage, TablePageComponent } from '@shared/components/table-page/table-page.component';
import { Body, _HttpClient } from '@delon/theme';
import { NzMessageService, NzModalRef, NzModalService } from 'ng-zorro-antd';
import { ApiService } from '@core/services/api';
import { STData } from '@delon/abc';

@Component({
  selector: 'app-watch-bind-person-list',
  templateUrl: './watch-bind-person-list.component.html',
  styles: []
})
export class WatchBindPersonListComponent implements OnInit {
  @ViewChild('st', { static: false }) st: TablePageComponent;
  selectData: any[];
  loading = false;
  @Input() type:number
  @Input()
  set _param(value) {
    if (!value) return;
    this.param = value;
    this.config.defaultParam={"qcCode":value.qrCode}
  };
  param: any;
  deviceType:string;
  submitDeviceType:string;
  show:boolean=false;
  config: SPage = {
    columns: [
      {
        index: 'name',
        title: '用户名称',
        filter: {
          placeholder: '请输入用户名',
          type: 'string'
        }
      },
      {
        index: 'phone',
        title: '联系电话',
        filter: {
          placeholder: '请输入联系电话',
          type: 'string'
        }
      },
      // {
      //   index: 'qcCode',
      //   title: '二维码sn'
      // },
      {
        index: 'isAdmin',
        title: '管理员',
        type:ColumnType.tag,
        tag:{
          true:{text: '是'},
          false:{text: '否'}
        },
        filter:{
            placeholder:'是否管理员',
            type:'select',
            items:[
              {label:"是",value:1},
              {label:"否",value:0},
            ]
        }
      },
      {
        index: 'description',
        title: '描述',
      },
      {
        index: 'createTime',
        title: "创建时间",
        type:ColumnType.date
      }
    ],
    showCheckBox: false,
    reqUrl:'/core/qrcode/peopleListByQcCode',
 
  }
  constructor(private http: _HttpClient,  private api: ApiService,private ref: NzModalRef, private modal: NzModalService, private message: NzMessageService) { }
  ngOnInit() {
    
  }
 
  _console(e: any): void {
    this.selectData = e;
  }
  dataProcess(data: STData[]){
    return data;
  }
 
}
